<template>
  <el-dialog v-model="dialogVisible" title="查看关联设备POS机SN号">
    <el-table border :data="posList">
      <el-table-column v-for="(item,index) in tableProps" :key="index" :label="item.label" :prop="item.prop" align="center"></el-table-column>
    </el-table>
  </el-dialog>
</template>
<script setup>
import { nextTick, ref, watchEffect } from 'vue'
const dialogVisible = ref(false)
const tableProps = ref([
  { prop: 'id', label: '序号' },
  { prop: 'pos_sn_no', label: 'POS机SN号' },
  { prop: 'sticker_num', label: '关联设备编号' },
])
const posList = ref([])

defineExpose({
  dialogVisible,
  posList
})

watchEffect(()=>{
  if(dialogVisible.value===false){
    nextTick(()=>{
      posList.value = []
    })
  }
})

</script>
<style lang="less" scoped>
</style>